//
//  BYAddImageView.h
//  ZhaoQiPei
//
//  Created by 找汽配 on 16/2/29.
//  Copyright © 2016年 祥运. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "XYImageSelectModel.h"

@protocol XYImageSelectCollectionViewAction;

@interface XYImageSelectCollectionView : UICollectionView

@property (nonatomic, assign) NSUInteger maxNumberOfImages;     // 最大图片数量
@property (nonatomic, strong) UIImage * selectImage;            // 选择图标
@property (nonatomic, strong) UIImage * deleteImage;            // 删除图标
@property (nonatomic, assign, getter=isEditEnabled) BOOL editEnabled; // 是否可编辑
@property (nonatomic, strong) NSMutableArray<XYImageSelectModel *>* models;
@property (nonatomic, weak) id<XYImageSelectCollectionViewAction> action;
@property (nonatomic, weak) id<XYImageSelectModelAction> modelAction;

// 设置图片
- (void)setImagesWithImages:(NSArray<UIImage *>*)images;
- (void)setImagesWithModels:(NSArray<XYImageSelectModel *>*)models;

// 已选择图片
- (void)didSelectImagesWithImages:(NSArray<UIImage *>*)images;
- (void)didSelectImagesWithModels:(NSArray<XYImageSelectModel *>*)models;

- (void)setCanMove:(BOOL)canMove; // 设置是否可拖拽

- (BOOL)isUploaded;                     // 是否已上传完毕
- (NSArray<NSString *>*)imageURLs;      // 图片链接

@end

@protocol XYImageSelectCollectionViewAction <NSObject>

- (CGSize)imageSelectCollectionViewSizeForItem;
- (void)imageSelectCollectionViewDidSelectImageWithModel:(XYImageSelectModel *)model;
- (void)imageSelectCollectionViewShouldSelectImagesWithCount:(NSInteger)count;
- (void)imageSelectViewWarnForTooManyImages;

@end
